home *** CD-ROM | disk | FTP | other *** search
- const
- MAX_TABLES = 4; {No. of Procos Tables}
-
- {Constants for the array of tables}
- TABLE_BACKUP = 1;
- TABLE_RECOVERY = 2;
- TABLE_REUSE = 3;
- TABLE_SUMMARY = 4;
-
- type
- {Types for handling tables without having controls on-screen}
- TableData = Array[1..MAX_TABLES] of TTable;
-
- var
- Data : TableData;
-
- procedure TfrmTables.InitialiseTables;
- var
- ptr : Integer;
- begin
- {Setup the Table Pointers ready for use}
- for ptr := 1 to MAX_TABLES do begin
- {Point to the component on the form}
- case ptr of
- TABLE_BACKUP : Data[ptr] := tblBACKUP;
- TABLE_RECOVERY : Data[ptr] := tblRECOVERY;
- TABLE_REUSE : Data[ptr] := tblREUSE;
- TABLE_SUMMARY : Data[ptr] := tblSUMMARY;
- end;
- end;
- end;
-
- { ... }
- { example: Scanning through a table }
-
- begin
- With Data[TABLE_BACKUP] do begin
- First;
- repeat
- {Do something, assuming there is at least one record in the table}
- Next;
- until Data[TABLE_BACKUP].Eof;
- end;
- end;